#pragma once

#include <string>
#include <iostream>
#include <windows.h>
#include <phidget21.h>
#include <exl.h>
#include "VoiceRecognizer.h"


class AccelerometerHandler : public exl::ps::ThreadBase
{
private:
	ICommandHandler * commandHandler;


	static int __stdcall AttachHandler(CPhidgetHandle IFK, void *userptr);
	static int __stdcall DetachHandler(CPhidgetHandle IFK, void *userptr);
	static int __stdcall ErrorHandler(CPhidgetHandle IFK, void *userptr, int ErrorCode, const char *unknown);
	static int __stdcall accel_AccelChangeHandler(CPhidgetAccelerometerHandle WGT, void *userptr, int Index, double Value);
	static int __stdcall display_properties(CPhidgetHandle phid);

public:
	static AccelerometerHandler * pThis;

	inline void setCommandHandler(ICommandHandler & wh) { commandHandler = &wh; }

	int run();
};

